import { request } from '@/utils/http'
import type {
  DepartData,
  OrderDetail,
  OrderListData,
  OrderPreData,
  OrderPreParams,
  OrderQuery,
  RateParams,
} from '@/types/consult'
/**
 * 医生科室列表
 */
export const departmentListApi = () => {
  return request.get<null, DepartData[]>('/dep/all')
}
// 问诊-支付页面
/**
 * 问诊-支付页面-计算就诊信息和抵扣信息
 * @param params
 * @returns
 */
export const preOrderApi = (params: OrderPreParams) => {
  return request.get<null, OrderPreData>('/patient/consult/order/pre', { params })
}

/**
 * 问诊订单详情
 */
export const orderDetailApi = (orderId: string) => {
  return request.get<null, OrderDetail>('/patient/consult/order/detail', { params: { orderId } })
}

/**
 * 评价医生
 */
export const evaluateDoctorApi = (data: RateParams) => {
  return request.post('/patient/order/evaluate', data)
}
/**
 * 医生问诊列表
 */
export const orderListApi = (data: OrderQuery) => {
  return request.get<null, OrderListData>('/patient/consult/order/list', { params: data })
}
